Hey everyone! 👋
Another week, another update on my GSoC journey with ProLIF!
📝 Current Pull Request Status
The primary task this week involved modularizing the function used to calculate coordinates for protein residues and adjusting the algorithm to express the strength of interaction between the ligand and the protein.
Splitting the function into smaller parts
The function has been split as follows:
Extract indices: Get the indices of protein and ligand atoms from the
df
.Calculate diagram dimensions*: Get the center, width, and height of the diagram, calculated using the atoms from
mol.GetConformer().GetPositions()
.Build NetworkX graph*: Create a NetworkX graph object with protein residues and ligand atoms as nodes. This might sound familiar 😉, as we added this as a separate feature to the
LigNetwork
class in week 3.Calculate initial positions*: Determine the initial positions for protein residues using the custom function I prepared in week 4.
Apply spring layout: Pass all this information to NetworkX’s
spring_layout
:= nx.spring_layout( pos G,=pos, # Initial positions for residues and fixed ligand atoms pos=ligand_indices, # Fix ligand atoms at their coordinates fixed=2, # Rescales the layout to a reasonable size scale=100, iterations=center, center="weight_spring_layout", weight )
Note:
weight_spring_layout
is10 / distance
, wheredistance
is the interaction distance between the ligand and the residue. We want residues with strong interactions to be close to the ligand, hencedistance
is in the denominator.Resolve overlaps*: Check for overlaps and push the overlapping residues apart. A new feature here is that the function now also checks for overlaps between residue and ligand atoms.
An asterisk signifies that the step has a separate function.
📆 What’s Next?
I’ll focus on completing the test file for the residue coordinates, which was on hold while I addressed these changes.
Thanks for reading and keeping up with my progress! More updates soon as we drive these visuals and tests forward. 🧬📊